<template>
  <div id="DetailList">
    <div class="detail">
      <component :data="{argument}"
                 :is="currentComponent"></component>
    </div>
  </div>

</template>

<script>
export default {
  name: "DetailList",
  data () {
    return {
      newFlag: false,
      argument: {},
      detailNav: "1",
      componentConfig: [
        {
          name: "Table",
          label: "table",
          component: () => import('./page/Table.vue')
        }
      ],
      selectData: []
    }
  },
  computed: {
    currentComponent () {
      return this.componentConfig[this.detailNav - 1].component;
    }
  },
  methods: {
    //选中的数据
    setSelectData (data) {
      this.selectData = data
    },
  },
  mounted () {
    if (Object.keys(this.$store.state.skip).length !== 0) {
      let data = this.$store.state.skip;
      this.argument = data.routeData;
      this.detailNav = data.detailListNav;
    } else {
      this.argument = this.$store.state.routeData;
    }
  },
  components: {},
  watch: {}
}
</script>

<style>
</style>
